package com.yang.controller.admin;

import com.yang.bean.MarketComment;
import com.yang.bean.common.BasePageInfo;
import com.yang.bean.common.BaseRespVo;
import com.yang.bean.common.CommonData;
import com.yang.service.admin.CommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName AdminCommentController
 * @Description TODO
 * @Author zhangdongdong
 * @Date 2022/9/8 14:55
 * @Version 1.0
 */
@RestController
@RequestMapping("admin/comment")
public class AdminCommentController {
    @Autowired
    CommentService commentService;

    @RequestMapping("list")
    public BaseRespVo list(BasePageInfo info, Integer userId, Integer valueId) {
        CommonData<MarketComment> data = commentService.list(info, userId, valueId);
        return BaseRespVo.ok(data);
    }

    @RequestMapping("delete")
    public BaseRespVo delete(@RequestBody MarketComment comment) {
        commentService.delete(comment);
        return BaseRespVo.ok();
    }
}
